import axios from "axios"


const request = axios.create({
    timeout: 5000
})
// 拦截请求前
request.interceptors.request.use((config) => {
    return config
}, (error) => {
    return Promise.reject(error)
})
request.interceptors.response.use((response) => {

    return response
}, (error) => {
    if(error.response.status!==200){
       console.log('接口错误')
    }
    return Promise.reject(error)
})

export default request